from enthought.traits.api import HasTraits, Int, Button
from enthought.traits.ui.api import View, Item, HGroup, ButtonEditor

class wedge(HasTraits):
    value = Int(0)
    totalhits = Int(0)
    
    Increase = Button()
    Decrease = Button()

    IncItem = Item(name='Increase', show_label=False,
                editor=ButtonEditor(label='+'))
    DecItem = Item(name='Decrease', show_label=False,
                editor=ButtonEditor(label='-'))
    ValItem = Item(name='value', style='readonly', show_label=False, emphasized=True)
    traits_view = View(HGroup(IncItem, DecItem, ValItem))

    def __init__(self, val):
        self.value = val

    def _Increase_fired(self):
      self.totalhits += 1
      self.value += 1
      print self.totalhits
      
    def _Decrease_fired(self):
      self.totalhits -= 1
      self.value -= 1
      print self.totalhits

if __name__ == "__main__":
  w1 = wedge(20)
  w1.configure_traits()
